//
// full dataset
//
FloatTable data;


// data min and max
float dataMin, dataMax;
int maxOffsetLayer;
float maxOffset;
int graphMode;

//boolean drawTrend;


// options
float optionX1, optionX2, optionY1, optionY2;
String[] optionLabel;
int nOption, selectedOption;

// coloring
float coloringX1, coloringX2, coloringY1, coloringY2;
String[] coloringLabel;
int nColoring, selectedColoring;

//Layer variables
float mapVal;
String[] years;
int columnCount, rowCount;
int numDivisions;
int numSamples;
int numData;
int layerIDtoStroke;
int highlightedLayer;
int dbclickedLayer;

int highlightedPoint;
int highlightedPointPos;

// Main Plot Variables
int mainPlotX1, mainPlotY1, mainPlotX2, mainPlotY2;

// timem line
int timeLineX1, timeLineX2, timeLineY;

// trend view plot variables
int trendPlotX1, trendPlotX2, trendPlotY1, trendPlotY2;

// Controller
Controller controller;
Controller controllerOld;
Controller controllerPrev;

//stroke integrator
ColorIntegrator color_integrator; 

// Utilities
// Highlighted layer
//int highlitedLayer;




//--------------------------------------------------------------------

float filterX1, filterX2, filterY1, filterY2;
int numFilters;
boolean onFilter;
int[] filtersChosen;
int checkBoxDim;
int numFilteredColumns;
PFont filterFont;




// time slider variables
int timeScrollBarX1, timeScrollBarX2, timeScrollBarY1, timeScrollBarY2;
int ltimeSliderPos, rtimeSliderPos;
int timeSliderDimX, timeSliderDimY;
int timeSliderPosY;

boolean isLTimeSlider, isRTimeSlider;
boolean onSlider;
int devMouse_LeftSlider;

// numDivisions variables
int numDivScrollBarX1, numDivScrollBarX2, numDivScrollBarY1, numDivScrollBarY2;
int numDivSliderPos;
int numDivSliderPosY;

boolean onnumDivSlider;

// num filter variables
// numDivisions variables
int numFiltersScrollBarX1, numFiltersScrollBarX2, numFiltersScrollBarY1, numFiltersScrollBarY2;
//int numFiltersSliderPos;
int numFiltersSliderPosY;
int lnumFiltersSliderPos, rnumFiltersSliderPos;
int numFiltersSliderDimX, numFiltersSliderDimY;

boolean isLNumFiltersSlider, isRNumFiltersSlider;
boolean onNumFiltersSlider;
int devMouse_LeftNumFiltersSlider;

int numFilterColumns;


// Hue Chooser Variables

int hueScrollBarX1, hueScrollBarX2, hueScrollBarY1, hueScrollBarY2;
int lhueSliderPos, rhueSliderPos;
int hueSliderDimX, hueSliderDimY;
int hueSliderPosY;

boolean isLHueSlider, isRHueSlider;
boolean onHueSlider;
int devMouse_LeftHueSlider;

// Hue Flip variables
int hueFlipPosX, hueFlipPosY;
int hueFlipDim;
int isHueFlip;




// Stauration Chooser Variables



int lumaScrollBarX1, lumaScrollBarX2, lumaScrollBarY1, lumaScrollBarY2;
int llumaSliderPos, rlumaSliderPos;
int lumaSliderDimX, lumaSliderDimY;
int lumaSliderPosY;

boolean isLLumaSlider, isRLumaSlider;
boolean onLumaSlider;
int devMouse_LeftLumaSlider;

// Hue Flip variables
int lumaFlipPosX, lumaFlipPosY;
int lumaFlipDim;
int isLumaFlip;

// Stauration Chooser Variables

int chromaScrollBarX1, chromaScrollBarX2, chromaScrollBarY1, chromaScrollBarY2;
int lchromaSliderPos, rchromaSliderPos;
int chromaSliderDimX, chromaSliderDimY;
int chromaSliderPosY;

boolean isLChromaSlider, isRChromaSlider;
boolean onChromaSlider;
int devMouse_LeftChromaSlider;

// Hue Flip variables
int chromaFlipPosX, chromaFlipPosY;
int chromaFlipDim;
int isChromaFlip;

//lock for numDiv
boolean lock;
